// components/Modal.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    bindconfirmFn: {
      type: Function,
      value:(e)=>{
console.log('2321',e)
      }
    },
    item:{
      type:[String,Object],
      value: {
        style: 'background:white;',
        cancelText: '确定',
        cancelIcon: '',
        title:'提示',
        content: {
          text: '今天的游戏次已用尽,点击右上角分享可获得额外次数。',
          style: 'color:#333',
        }
      },
    } 

  },
  /**
   * 组件的初始数据
   */
  data: {
    _style: '',
    
    visiable:true
  },

  /**
   * 组件的方法列表
   */
  methods: {
    bindVisiable(target,visiable){
      var ev = {
        target,
        visiable
      } 
      this.properties.bindconfirmFn(ev)
      console.log('21312', this, visiable)
      this.setData({
        visiable
      })
    },
    bindcancel(ev){
      this.bindVisiable(ev,false)
    },
    bindconfirm(ev) {
      this.bindVisiable(ev,false)
    },
    _style: (item) => {
      console.log('sdsd', str)
      let str = ''
      for (let n in item) {
        str += n ? n + ':' + item[i] + ';' : '';
      }
      
      this.setData({
        _style: str
      })

    },
  },
  ready() {
    global.chatroom = this
   // this.initRoom()
    //this.fatalRebuildCount = 0
  },
})
